package com.ficus.road.maintain.ditalTwin.controller;

import com.ficus.road.maintain.ditalTwin.service.ImportService;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequiredArgsConstructor
public class ImportController {
    private final ImportService importService;
    @PostMapping("/sync/v1/import/single")
    public ResponseEntity<String> importMossData(@RequestParam("pb") MultipartFile image) throws Exception {
        byte[] imageByte = image.getBytes();
        importService.importFile(imageByte);

        return ResponseEntity.ok("11");
    }

}
